<script>
	import {appConfig} from "@/api/common.js"
	export default {
		globalData: {
			openMemberRegister: "", //开放注册 1表示开放注册，0表示关闭注册
			regMustProxyCode: "" // 会员注册时是否必须填写代理推广码 1 必填 0 非必填
		},
		onLaunch: function() {
			console.log('App Launch');
			this.getAppConfig()
		},
		onShow: function() {
			console.log('App Show');
		},
		onHide: function() {
			console.log('App Hide');
		},
		methods:{
			getAppConfig(){
				appConfig().then(res => {
					if(res.code == 0){
						this.globalData.openMemberRegister = res?.data?.openMemberRegister;
						this.globalData.regMustProxyCode = res?.data?.regMustProxyCode;
						uni.setStorageSync('regMustProxyCode',res?.data?.regMustProxyCode);
						uni.setStorageSync('openMemberRegister',res?.data?.openMemberRegister)
					}
					else{
						this.UTILS.logStr(res.msg || "获取配置失败")
					}
				})
			}
		}
	};
</script>

<style lang="scss">
	/************************************************************
  ** 请将全局样式拷贝到项目的全局 CSS 文件或者当前页面的顶部 **
  ** 否则页面将无法正常显示                                  **
  ************************************************************/
	@import '@/common/css/index.scss';
</style>